<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script>
			// 实现时间的显示功能，(Date)
			// 要求能显示星期几，年月日，小时分钟秒
			function time(){
				var date=new Date();
				var year=date.getFullYear();
				var month=date.getMonth()+1;//MONTH属性从0开始
				var day=date.getDate();
				var week=date.getDay();
				var hour=date.getHours();
				var minute=date.getMinutes();
				var second=date.getSeconds();
				second=second<?"0"+second:second;
				var current = year+"-"+month+"-"+day+" "+"星期"+week+" "+hour+":"+minute+":"+second;
								
								document.getElementById("time").innerHTML=current;
							}
							
							setInterval("time()",1000);//每隔1000毫秒（即1秒）显示一次当前时间
				
			
			}
		</script>
	</body>
</html>